// Combining data pump/function
// Copyright 2006 (C) Ralph Thomas

#ifndef MISSION_DATAPUMPS_COMBINE_H
#define MISSION_DATAPUMPS_COMBINE_H

#include <adobe/value.hpp>
#include <adobe/dictionary.hpp>
#include <adobe/array.hpp>
#include <adobe/adam.hpp>

namespace datapumps {
	//
	/// The combine datapump will perform multiple actions when invoked,
	/// and these actions are other datapumps. There are two forms, one
	/// takes a dictionary which has "actions" (an array of actions) and
	/// "active" (a data pump that returns a boolean); the other is an
	/// array function that just takes the list of actions to invoke.
	///
	/// \param	parameters	dictionary containing "actions" array
	///				and optionally "active" data pump.
	/// \param	sheet		sheet to resolve @names into.
	/// \return	a new combined datapump.
	//
	adobe::value_t make_combine_datapump( const adobe::dictionary_t& parameters, adobe::sheet_t& sheet );
	adobe::value_t make_combine_datapump( const adobe::array_t& parameters, adobe::sheet_t& sheet );
}

#endif

